import execjs
import requests
execjs.get().encoding = 'utf-8'

res = requests.post('https://vip.xiniudata.com/api/vip/web/login/login_by_password', json={
    "payload": {
        "account": "15003884159",
        "password": "Fan030311"
    },
    "v": -20180620
})
print(res.cookies)

with open("./parse/3.犀牛数据.js", "r", encoding="utf-8") as f:
    js_str = f.read()
    js_code = execjs.compile(js_str, cwd="./parse")

payload = {
    "libraryId": 33,
    "sectionId": 208,
    "filterConfigIds": [
        271,
        269,
        270,
        1404,
        889,
        305,
        272,
        266,
        1825,
        267,
        268,
        1162
    ],
    "queryParam": {
        "start": 0,
        "limit": 20,
        "searchFieldIds": None,
        "is_oversea": [
            "1",
            "2",
            "3",
            "4"
        ],
        "query_field_ids": None
    }
}
json_data = js_code.call("get_data", payload)

res = requests.post('https://vip.xiniudata.com/api/vip/library/v3/init', json=json_data, cookies=res.cookies)
print(res)
d = res.json()['d']
data = js_code.call("parse_d", d)
print(data)